import { request } from "@/utils/service"
import type * as obj from "./types/lesson"
import { IdForm } from "../common/common"

export function getLessonDataApi(data: obj.GetData) {
  return request<obj.LessonData[]>({
    url: "/mp/lesson/list",
    method: "get",
    params: data
  })
}

export function getLessonInfoApi(data: IdForm) {
  return request<obj.LessonData>({
    url: "/mp/lesson/info",
    method: "get",
    params: data
  })
}

/** 获取用户详情 */
export function saveLessonDataApi(data: obj.CreateOrUpdateLessonRequestData) {
  return request<string>({
    url: "/mp/lesson/save",
    method: "post",
    data
  })
}

export function deleteLessonDataApi(data: IdForm) {
  return request<string>({
    url: "/mp/lesson/delete",
    method: "post",
    data
  })
}
